package cn.xunfang.test;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Panel;
import java.util.Random;


public class GamePanel extends Panel{
	Random random = new Random();
	int xs[] = new int[300];
	int ys[] = new int[300];
	public GamePanel(){
		for(int i = 0;i<xs.length;i++){
			xs[i] = random.nextInt(1024);
			ys[i] = random.nextInt(768);
		}
	}
	public void paint(Graphics g){
		g.clearRect(0, 0, 1024, 768);
		g.setColor(Color.WHITE);
		for(int i =0;i<300;i++){
			//g.drawString("*", xs[i], ys[i]);
			g.drawString("*",xs[i],ys[i]);
		}
		try {
			Thread.sleep(10);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		for(int i =0;i<300;i++){
			ys[i] = ys[i]+1;
		}
		repaint();
	}
}
